﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DbSharp.Framework.CaseFile.Parser;

namespace DbSharp.Framework.TestEngine
{

    public class CaseFileLoader
    {
        #region Private members

        private CaseFileParser m_FileParser; 

        #endregion


        public CaseFileLoader(CaseFileParser fileParser)
        {
            m_FileParser = fileParser; 
        }

        #region Public method/property 

        public List<PerfTestRunner> LoadPerfCaseRunners()
        {
            List<PerfTestRunner> list = new List<PerfTestRunner>();
            foreach (var testCase in m_FileParser.ListPerfTestCase)
            {
                PerfTestRunner runner = new PerfTestRunner(testCase);
                list.Add(runner);
            }
            return list;
        }

        public List<UnitTestRunner> LoadUnitCaseRunners()
        {
            List<UnitTestRunner> list = new List<UnitTestRunner>();
            foreach (var testCase in m_FileParser.ListUnitTestCase)
            {
                UnitTestRunner runner = new UnitTestRunner(testCase);
                list.Add(runner);
            }
            return list;
        }

        #endregion
    }


}
